﻿using System;
using System.Collections.Generic;
using $projectname$.Core.Presenters;
using $projectname$.Core.Views;
using $projectname$.Core.Services;
using $projectname$.Core.DataTransferObjects;

namespace $projectname$.Presenter
{
   public class SamplePresenter : ISamplePresenter
    {
       private readonly ISampleService service;
       private readonly ISampleView view;

       public SamplePresenter(ISampleService service, ISampleView view)
       {
           if(service == null) throw new ArgumentNullException("service", "SamplePresenter must have a non null service");
           if(view == null) throw new ArgumentNullException("view", "SamplePresenter must have a non null view");
           this.view = view;
           this.service = service;
       }

       public ISampleService Service
       {
           get{ return service;}
       }
       public ISampleView View
       {
           get{ return view;}
       }

       public void Initialise()
       {
           IList<SampleDto> samples = Service.GetAllSamples();
           View.LoadSamples(samples);
       }

       //Add additon methods and events here.
    }
}
